import request from '@/utils/request'

export function getPage(data) {
  return request({
    url: '/catalogManage/getPage',
    method: 'post',
    data
  })
}

export function saveData(data) {
  return request({
    url: '/catalogManage/save',
    method: 'post',
    data
  })
}

export function editData(data) {
  return request({
    url: '/catalogManage/edit',
    method: 'post',
    data
  })
}

export function updateState(data) {
  return request({
    url: '/catalogManage/updateState',
    method: 'post',
    params: data
  })
}

export function getInfo(data) {
  return request({
    url: '/catalogManage/getInfo',
    method: 'get',
    params: data
  })
}

export function copyData(data) {
  return request({
    url: '/catalogManage/copy',
    method: 'post',
    data
  })
}

export function downloadTemplate() {
  return request({
    url: '/catalogManage/downloadTemplate',
    method: 'post',
    responseType: 'blob'
  })
}

export function getListByCode(data) {
  return request({
    url: '/catalogManage/getListByCode',
    method: 'get',
    params: data
  })
}
